# -*- coding:utf-8 -*-
"""
Author：Administrator
Date:2021年12月10日
"""
import matplotlib.pyplot as plt
import pandas as pd

df = pd.read_excel('../source/books - 5.6.6.2.xlsx',sheet_name='Sheet2')
plt.rcParams['font.sans-serif'] = ['SimHei'] # 解决中文乱码

x = df['年份']
y1 = df['京东']
y2 = df['天猫']
y3 = df['自营']
plt.stackplot(x,y1,y2,y3,colors=['#6d904f','#fc4f30','#008fd5'])
plt.legend(['京东','天猫','自营'], loc='upper left')
plt.show()

print(df)